#pragma once

#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>

struct list_head
{
	struct list_head *next, *prev;
};

struct hlist_node
{
	struct hlist_node *next, **pprev;
};

struct hlist_head
{
	struct hlist_node *first;
};

#define DECLARE_BITMAP(name, bits) \
	unsigned long name[(bits + (sizeof(long) * 8) - 1) / (sizeof(long) * 8)]

typedef uint32_t u32;
typedef uint64_t u64;
typedef int64_t s64;
typedef uint8_t u8;
typedef int16_t s16;
typedef uint16_t u16;
typedef int32_t s32;

typedef unsigned int gfp_t;

typedef struct
{
	int counter;
} atomic_t;

typedef struct
{
    s64 counter;
} atomic64_t;

#define ATOMIC_INIT(i) { (i) }

typedef unsigned short gid_t;
typedef unsigned short umode_t;
typedef unsigned int fmode_t;

typedef uint64_t sector_t;
typedef uint64_t blkcnt_t;

typedef uint32_t __u32;
typedef uint64_t __u64;

typedef long ino_t;
typedef int dev_t;

typedef unsigned long ulong;

typedef long long loff_t;
typedef long off_t;

/*
 * The type of an index into the pagecache.
 */
typedef unsigned long pgoff_t;

typedef uintptr_t phys_addr_t;

typedef long ssize_t;
